<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>操作表单属性</title>
</head>

<body>
  <input type="text" placeholder="请输入文字" value="电脑">
  <script>
    const uname = document.querySelector('input')
    // 获取输入框的值
    console.log(uname.value);
  </script>

</body>

</html>